package schoolWork.work03.Example1;

public class Demo {
    public static void main(String[] args) {
        System.out.println("----------------------");
        Car myCar1 = new Car();
        myCar1.setBrand("BYD");
        myCar1.setLicensePlateNumber("苏E223344");
        myCar1.showInfo();//调用的是子类car 的 showInfo()
        System.out.println("----------------------");
        Car myCar2 = new Car("Benz", 4, "沪E112233");
        myCar2.showInfo();// 调用的是子类 car 的 showInfo()
        System.out.println("----------------------");
        Bicycle myBicycle1 = new Bicycle();
        myBicycle1.setBrand("Giant");
        myBicycle1.setForPeople("Kid");
        myBicycle1.showInfo();// 调用的是子类 Bicycle 的 showInfo()
        System.out.println("----------------------");
        Bicycle myBicycle2 = new Bicycle("Forever", 2, "Female");
        myBicycle2.showInfo();// 调用的是子类 Bicycle 的 showInfo()
    }
}
